package com.common
{
	import flash.events.Event;
	
	public class GlobalEvent extends Event
	{
		/** 删除item事件 */
		public static var MINUSITEMEVENT:String = "MINUSITEMEVENT";
		/** 打开修改proto面板 **/
		public static var OPEN_PROTO_UPDATE_PANEL:String = "PROTO_CONFIG_UPDATE";
		/**
		 * 保存配置文件
		 * **/
		public static var SAVE_PROTO_CONFIG:String = "SAVE_PROTO_CONFIG";
		
		/**
		 * 添加一个proto类
		 * **/
		public static var ADD_PROTO_CONFIG:String = "ADD_PROTO_CONFIG";

		public var obj:Object;
		
		public function GlobalEvent(type:String, obj:Object = null, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			this.obj = obj;
		}
		
		public function get relatedObject():Object
		{
			return obj;
		}
		
		public override function clone():Event 
		{ 
			return new GlobalEvent(type, bubbles, cancelable);
		} 
		
		public override function toString():String 
		{ 
			return formatToString("GlobalEvent","relatedObject", "type", "bubbles", "cancelable", "eventPhase"); 
		}
	}
}